package org.leumasjaffe.initiativeTracker.distributed.controller;


import org.eclipse.jdt.annotation.NonNullByDefault;
import org.leumasjaffe.initiativeTracker.Constants;

import edu.wpi.heineman.xml.Message;
import edu.wpi.heineman.client.IMessageHandler;
import edu.wpi.heineman.client.ServerAccess;

@NonNullByDefault
public class ConnectHandler implements IMessageHandler {

	@Override
	public void process(Message response) {
		String xmlString = Message.requestHeader() + "<initiativeRequest game='" + Constants.id + 
				"'/></request>";
		Message m = new Message(xmlString);
		ServerAccess.getInstance().sendRequest(m);
	}

	@Override
	public IMessageHandler newCopy() {
		return new ConnectHandler();
	}

}
